/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package MobileArchitecture.impl;

import MobileArchitecture.Attribute;
import MobileArchitecture.DataType;
import MobileArchitecture.GeolocatedAttribute;
import MobileArchitecture.Mobile;
import MobileArchitecture.MobileArchitectureFactory;
import MobileArchitecture.MobileArchitecturePackage;
import MobileArchitecture.MobileEntity;
import MobileArchitecture.MobilePresentationModel;
import MobileArchitecture.MobileView;
import MobileArchitecture.MobileViewModel;
import MobileArchitecture.Server;
import MobileArchitecture.ServerBO;
import MobileArchitecture.ServerDAO;
import MobileArchitecture.ServerEntity;
import MobileArchitecture.ServerService;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class MobileArchitectureFactoryImpl extends EFactoryImpl implements MobileArchitectureFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static MobileArchitectureFactory init() {
		try {
			MobileArchitectureFactory theMobileArchitectureFactory = (MobileArchitectureFactory)EPackage.Registry.INSTANCE.getEFactory("http://co.edu.uniandes/mobileTest/1.0/architecture"); 
			if (theMobileArchitectureFactory != null) {
				return theMobileArchitectureFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new MobileArchitectureFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileArchitectureFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case MobileArchitecturePackage.SYSTEM: return createSystem();
			case MobileArchitecturePackage.SERVER: return createServer();
			case MobileArchitecturePackage.SERVER_ENTITY: return createServerEntity();
			case MobileArchitecturePackage.SERVER_SERVICE: return createServerService();
			case MobileArchitecturePackage.SERVER_DAO: return createServerDAO();
			case MobileArchitecturePackage.SERVER_BO: return createServerBO();
			case MobileArchitecturePackage.MOBILE: return createMobile();
			case MobileArchitecturePackage.MOBILE_ENTITY: return createMobileEntity();
			case MobileArchitecturePackage.MOBILE_VIEW: return createMobileView();
			case MobileArchitecturePackage.MOBILE_VIEW_MODEL: return createMobileViewModel();
			case MobileArchitecturePackage.MOBILE_PRESENTATION_MODEL: return createMobilePresentationModel();
			case MobileArchitecturePackage.ATTRIBUTE: return createAttribute();
			case MobileArchitecturePackage.GEOLOCATED_ATTRIBUTE: return createGeolocatedAttribute();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case MobileArchitecturePackage.DATA_TYPE:
				return createDataTypeFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case MobileArchitecturePackage.DATA_TYPE:
				return convertDataTypeToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileArchitecture.System createSystem() {
		SystemImpl system = new SystemImpl();
		return system;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Server createServer() {
		ServerImpl server = new ServerImpl();
		return server;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServerEntity createServerEntity() {
		ServerEntityImpl serverEntity = new ServerEntityImpl();
		return serverEntity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServerService createServerService() {
		ServerServiceImpl serverService = new ServerServiceImpl();
		return serverService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServerDAO createServerDAO() {
		ServerDAOImpl serverDAO = new ServerDAOImpl();
		return serverDAO;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServerBO createServerBO() {
		ServerBOImpl serverBO = new ServerBOImpl();
		return serverBO;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Mobile createMobile() {
		MobileImpl mobile = new MobileImpl();
		return mobile;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileEntity createMobileEntity() {
		MobileEntityImpl mobileEntity = new MobileEntityImpl();
		return mobileEntity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileView createMobileView() {
		MobileViewImpl mobileView = new MobileViewImpl();
		return mobileView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileViewModel createMobileViewModel() {
		MobileViewModelImpl mobileViewModel = new MobileViewModelImpl();
		return mobileViewModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobilePresentationModel createMobilePresentationModel() {
		MobilePresentationModelImpl mobilePresentationModel = new MobilePresentationModelImpl();
		return mobilePresentationModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Attribute createAttribute() {
		AttributeImpl attribute = new AttributeImpl();
		return attribute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GeolocatedAttribute createGeolocatedAttribute() {
		GeolocatedAttributeImpl geolocatedAttribute = new GeolocatedAttributeImpl();
		return geolocatedAttribute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataType createDataTypeFromString(EDataType eDataType, String initialValue) {
		DataType result = DataType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertDataTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MobileArchitecturePackage getMobileArchitecturePackage() {
		return (MobileArchitecturePackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static MobileArchitecturePackage getPackage() {
		return MobileArchitecturePackage.eINSTANCE;
	}

} //MobileArchitectureFactoryImpl
